package com.jymj.enumEntity.floatpopu;

/**
 * Created by ljj on 2018/9/26. 婚姻状况
 */
public enum HyzkEnum {
    two("未婚", 10),
    nine("已婚", 20),
    three("丧偶", 30),
    four("离婚", 40),
    gf("再婚", 50),
    gg("未达法定年龄", 60),
    five("不详", 90),;
    // 成员变量
    private String name;
    private int index;

    // 构造方法
    private HyzkEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (HyzkEnum s : HyzkEnum.values()) {
            if (s.getIndex() == index) {
                return s.name;
            }
        }
        return null;
    }

    // get set方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
